<?php
if( !isset($_SESSION['user_id']) ){
	session_unset();
	exit('0');
}
	
$user_id = $_SESSION['user_id'];
$userName = $_SESSION['userName'];	
$password = $_SESSION['password'];
$randompass = $_SESSION['randompass'];

if( 0 != $user_id ){
	$sql = 'SELECT * FROM `'.DB_PRE.'user` WHERE `id` = '. $user_id .' and `userName` = "'. $userName .'" and `passWord` = "'. $password .'" and `randompass` = "'. $randompass .'" ';
	$user = $dbs -> select($sql);
	$user = $user[0];
	if( 0 == count($user) ){
		session_unset();
		exit(0);
	} 
	initUserLogin($user);
	echo 1;
}

?>